<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
			
			<button type="default" @click="gotoList">gotoList</button>

		</view>
		<text>{{name}}</text>
		
		<text>{{textValue}}</text>
		<button :type="buttontype" @click="changeTextValue()">修改为798</button>
		
		<view>{{ num + 1}}</view>
		<view>{{ ok ? 'YES' : 'NO' }}</view>
	    <view>{{ name.split('').reverse().join('') }}</view>
		
		<view v-for="(item,index) in list">
			<view :class="'list-'+index%2">{{item}}</view>
		</view>
		
		<view>指令 v-bind : ... v-on: @  ... v-once v-html</view>
		<view>Class Style ; v-if，v-else ; v-show; v-for</view>
		<view>事件监听 @</view>
		<button @click="greet">Greet</button>
		<view>表单 v-model 等</view>
		<view>计算属性computer vs 方法 ； watch 等</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				name : 'wangwei108',
				textValue:'123',
				
				num : 1,
				ok : true,
				list: ['恰同学少年','风华正茂','数风流人物','还看今朝','问苍茫大地','谁主沉浮']
			}
		},
		onLoad() {
			console.log("onLoad")
		},
		methods: {
			changeTextValue(){
				this.textValue = '798'
			},
			greet(event){
				console.log(event)
				// uni.showToast({
				// 	title:'Hello ' this.name + ' !'
				// })
			},
			gotoList(){
				uni.navigateTo({
					url:"../opendb-contacts/list"
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	.list-0{
	    background-color: #aaaaff;
	  }
	  .list-1{
	    background-color: #ffaa7f;
	  }
</style>
